package com.irdstudio.efp.e4a.common.constant;

import java.util.regex.Pattern;

public class ValidateCheck {
	
	/**
	 * 规则：密码必须包含数字、字母或特殊字符(~!@#$%^&*)的至少两种
	 */
	private static final Pattern pattern = Pattern.compile("((?=.*[a-zA-Z])(?=.*\\d)|(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])|(?=.*\\d)(?=.*[~!@#$%^&*])|(?=.*[a-zA-Z])(?=.*\\d)(?=.*[~!@#$%^&*]))[a-zA-Z\\d~!@#$%^&*]{5,16}");

	/**
	 * 密码规则校验
	 * @param password
	 * @return
	 */
	public static boolean validatePasswordRule(String password) {
		return pattern.matcher(password).matches();
	}
	
	public static void main(String[] args) {
		//System.out.println(ValidateCheck.validatePasswordRule("123456fuzm"));
	}
}
